package qscript;

import org.qscript.Solver;
import org.qscript.operator.Operator;
import org.qscript.operator.OperatorSet;

import processing.core.PApplet;

public class AddingNewFunction extends PApplet {

	
	public void setup(){
		HypotenuseFunction h = new HypotenuseFunction("hypot", 2, 30, Operator.FUNCTION);
		OperatorSet.get().addOperator(h);
		
		String code = "$h = hypot(3, 4); println('Hypotenuse = ' + $h)";
		Solver.evaluate(code);
	}
	
	
}